package com.lq.tech.service.index;

import com.lq.tech.infra.PageCommonVO;
import com.lq.tech.infra.SearchCommonVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lq.tech.dao.entity.index.IndexFloorInfoDO;
import com.lq.tech.dao.mapper.index.IndexFloorInfoMapper;
import com.lq.tech.service.vo.index.IndexFloorInfoVO;
import com.lq.tech.infra.ErrorCode;
import com.lq.tech.service.BaseService;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
public class IndexFloorInfoService extends BaseService<IndexFloorInfoVO, IndexFloorInfoDO>
{
    @Autowired
    private IndexFloorInfoMapper indexFloorInfoMapper;

    public IndexFloorInfoService()
    {
        super(IndexFloorInfoVO.class, IndexFloorInfoDO.class);
    }

    ;

    @PostConstruct
    public void init()
    {
        super.addMapper(indexFloorInfoMapper);
    }

    @Override
    public IndexFloorInfoVO item(String id)
    {
        return super.item(id);
    }

    @Override
    public PageCommonVO list(SearchCommonVO<IndexFloorInfoVO> condition)
    {
        return super.list(condition);
    }

    @Override
    public ErrorCode insert(IndexFloorInfoVO indexFloorInfo)
    {
        return super.insert(indexFloorInfo);
    }

    @Override
    public ErrorCode update(IndexFloorInfoVO indexFloorInfo)
    {
        return super.update(indexFloorInfo);
    }

    /**
     * 查询楼层信息
     *
     * @param floorId String
     * @return List<IndexFloorInfoDO>
     */
    public List<IndexFloorInfoVO> listByFloor(String floorId)
    {
        return getVOList(indexFloorInfoMapper.listByFloor(floorId));
    }
}
